﻿using Microsoft.AspNetCore.Identity;
using System.ComponentModel.DataAnnotations.Schema;

namespace AspNetMVCTodo.Models
{
    /// <summary>
    /// Entity Framework Core 使用以下约定：
    ///     IdentityUser 类 → AspNetUsers 表
    ///     IdentityRole 类 → AspNetRoles 表
    ///     IdentityUserClaim 类 → AspNetUserClaims 表
    /// </summary>

    //所以不需要添加该表
    [Table("AspNetUsers")]
    public class ApplicationUser: IdentityUser
    {
        //--已有字段--
        //public required string Id { get; set; }

        //public int AccessFailedCount { get; set; }

        //public string? ConcurrencyStamp { get; set; }

        //public string? Email { get; set; }

        //public int EmailConfirmed { get; set; }

        //public int LockoutEnabled { get; set; }

        //public string? LockoutEnd { get; set; }

        //public string? NormalizedEmail { get; set; }

        //public string? NormalizedUserName { get; set; }

        //public string? PasswordHash { get; set; }

        //public string? PhoneNumber { get; set; }

        //public int PhoneNumberConfirmed { get; set; }

        //public string? SecurityStamp { get; set; }

        //public int TwoFactorEnabled { get; set; }

        //public string? UserName { get; set; }

        //--自定义字段--
        //软删除字段
        public bool IsDeleted { get; set; } = false;

        // 删除时间
        public DateTime? DeletedAt { get; set; }

        // 删除操作人（可选）
        public string? DeletedBy { get; set; }

    }
}
